import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/Login.vue'
// import Home from '../view/Home.vue'
const Home = () => import('../view/Home.vue')
const User =()=> import('../view/User.vue')
const UserManage=()=>import('../view/systemSet/userManage.vue')
const Dictionary=()=>import('../view/systemSet/dictionary.vue')
const DataManage=()=>import('../view/systemSet/dataManage.vue')
const LogAudit =()=>import('../view/systemSet/logAudit.vue')
const CommunityCenter=()=>import("../view/smartCommunity/communityCenter.vue")
const DataContent =()=>import("../view/smartCommunity/dataContent.vue")
const PersonCenter=()=>import("../view/smartCommunity/personCenter.vue")
const ProcessingCenter=()=>import("../view/smartCommunity/processingCenter.vue")

Vue.use(VueRouter)

const routes=[
  { path: '/', redirect: '/login' },
  { path: '/login', name: 'login', component: Login },
  {path:'/user',name:'user',component:User,
  redirect:"/community/communityCenter",
  children:[
    {path:'/community/communityCenter',
    name:"communityCenter",
     component:CommunityCenter
  },
  {path:'/community/dataContent',
  name:"dataContent",
   component:DataContent 
  },
  {
    path:'/community/personCenter',
    name:"personCenter",
    component:PersonCenter
  },
  {
    path:'/community/processingCenter',
    name:"processingCenter",
    component:ProcessingCenter
  }
  ]},
  { path:'/home', name:'home',
  redirect:'/system/userManage',
  component:Home ,
  children:[
    //用户管理
    {path:'/system/userManage',
     name:'userManage',
     component:UserManage   
  },
    //字典维护
    {path:'/system/dictionary',
    name:'dictionary',
    component:Dictionary   
 },
    // 数据管理
    {path:'/system/dataManage',
     name:'dataManage',
     component:DataManage
      
  },
    // 日志审计
    {path:'/system/logAudit',
     name:'logAudit',
     component:LogAudit
      
  }
  ]
}
]

const router=new VueRouter({
  routes
})

export default router